package compound.duck;import compound.pattern.Observable;import compound.pattern.Observer;import compound.pattern.Quackable;/** * Created by Administrator on 2018-11-8. */public class MallardDuck implements Quackable {    Observable observable;    public MallardDuck(){        observable = new Observable(this);    }    public void quack() {        System.out.println("Quack");        notifyObservers();    }    public void registerObserver(Observer observer) {        observable.registerObserver(observer);    }    public void notifyObservers() {        observable.notifyObservers();    }}